All Questions
Tagged with memory-optimizationperformance
106 questions
5votes
2answers
175views
LeetCode Number 416: Partition Equal Subset Sum
Problem: MLE I am confused as to why the LeetCode judge reports Memory Limit Exceeded when my solution looks close to the editorial solution. I not too familiar with ...
7votes
1answer
206views
Robin Hood Hash Table
The following code comes from an intrusive container library I am working on in C23. So far, it works correctly due to extensive testing and sample programs I have written with it. I have implemented ...
8votes
2answers
196views
Leetcode 93: Restore IP Addresses (C version)
This is posted in response to this request made in a discussion of my "C-ish" answer to a recent Code Review question regarding a Python solution to a Leetcode challenge. It was reported ...
1vote
0answers
34views
Optimizing MJPEG stream handling in Service Worker
Background: I'm implementing a small react app in which an MJPEG stream transmitted by HTTPS is displayed. The stream is only accessible if the user is authorized (using Basic Auth). Therefore, I can ...
3votes
1answer
89views
Check which sinks are connected in the pipe system using Python
It would be very helpful to me as a beginner if I could get feedback on my code, specifically about the efficiency of algorithm used and potential improvements in code quality. Code context: There is ...
5votes
3answers
231views
HackerRank, Haskell simple "compression" algorithm
The question asked is very straight-forward and is simple enough to solve. What I am looking for is that hopefully I can get some understanding for using the constructs and built-ins of the Haskell ...
4votes
2answers
66views
Optimizing a Function to Generate a Row of Consecutive Odd Numbers in a Triangle
I've written a JavaScript function that generates a row of consecutive odd numbers in a triangle. The triangle looks like this: ...
5votes
4answers
1kviews
Optimized Python Solution for Determining if an Array Contains All Possibilities
Problem: You have been tasked with writing a method named is_all_possibilities (or IsAllPossibilities, as per your preference) ...
3votes
1answer
57views
A collection based on a bitset to store a set of unique integers from a given range (rev. 3)
All right, let's do this one last time. This is continuation of this review. I applied most of the proposed changes, making interface of my container very close to that of ...
4votes
1answer
89views
A collection based on a bitset to store a set of unique integers from a given range (rev. 2)
This is a continuation of this review. I applied most of the proposed changes. These changes were focused mostly on decoupling the class from the rest of the program and making its interface more like ...
10votes
1answer
311views
Construct a performant sieve of Atkin in Rust
I have implemented the sieve of Atkin in Rust. It can find all primes till 1,000,000,000 in 4.5 s using 34.4 MiB on my 1.4 GHz machine. This is a direct implementation (with some optimisations made ...
2votes
4answers
183views
Comparison of two excel files ignoring line order
Below is a simple method which compares contents of two excel files ignoring the line order. This method is working as expected. But, one of my peers in their code review mentioned that initializing ...
0votes
1answer
52views
Aggregate transactions in slips
I wrote code to aggregate transactions in slips. I'm concerned with the performance of my code because it uses 3 loops that are nested so the time complexity will be cubic. This code won't scale well ...
1vote
1answer
543views
Comparison of lists of intervals
From the following script, the "similarity" function should be callable to compare two sets of lists and return a certain similarity score. The elements of the lists represent intervals, so [...
1vote
1answer
212views
Large file log parser with less memory footprint
This is a variation of an interesting problem I am currently dealing with. We have a large input file which is being continuously written (size: 10-20G). We need to write a log filter which reads ...